package step3;
//给定两个数，求这两个数的最大公约数
import java.util.Scanner;

public class GreatestCommonDivisorgcd {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = a%b;
        while (true) {
            a = b;
            b = c;
            c = a%b;
            if(c == 0)
                break;
        }
        System.out.println("最大公约数为" + b);
    }
}
